#ifndef __MCU_CFG_H
#define __MCU_CFG_H
#include "stdio.h"
#include "string.h"
#include "stdarg.h"	 
#include "math.h"

#include "sys.h"

#include "data_proc.h"
#include "led.h"
#include "dmx512_a.h"
#include "GD_IAP.h"
#include "hub.h"
#include "delay.h"
#include "com.h"
#include "mmc_spi.h"
#include "mmc_sd.h"
#include "play.h"
#include "ext.h" 
#include "addr_write.h"  

#include "ff.h"

extern	void Mcu_Cfg_Init(uint32_t dmx_freq,uint32_t dmx_freq_a);
extern	void bound_DMX(u16 bound);

#define LED0				PBout(4)
#define DMX_TX_ON			PAout(15) = 1; 
#define DMX_TX_OFF			PAout(15) = 0; 
#define DMX_BREAK_HIGH		PAout(9) = 1; 
#define DMX_BREAK_LOW		PAout(9) = 0; 


#define L_SPI_EN_ON				PAout(8) = 0; 
#define L_SPI_EN_OFF			PAout(8) = 1; 
#define SCK_EN_ON					PBout(12) = 0; 
#define SCK_EN_OFF				PBout(12) = 1; 
#define L_SCI_EN_ON				PBout(3) = 0; 
#define L_SCI_EN_OFF			PBout(3) = 1; 

#define SEND_0						PBout(15) = 0; 
#define SEND_1						PBout(15) = 1; 



#define TF_POWER_ON			PAout(4) = 0; 
#define TF_POWER_OFF		PAout(4) = 1;

#define BL_Mode				PAout(1)

#define TF_CS				PBout(1)
#define TOUT0				PBout(5)
#define TOUT1				PBout(8)
#define TOUT2				PBout(7)
#define TOUT3				PBout(6)
//#define LED0				PBout(8)
//#define LED0				PBout(8)
//#define LED0				PBout(8)
//#define LED0				PBout(8)

//#define	CKA_SET		GPIOA->BOR = GPIO_PIN_9
//#define	CKA_CLR		GPIOA->BCR = GPIO_PIN_9
//#define	CKA_ON		GPIOA->BCR = GPIO_PIN_10
//#define	CKA_OFF		GPIOA->BOR = GPIO_PIN_10
//#define	DOUT_ON		GPIOB->BCR = GPIO_PIN_6
//#define	DOUT_OFF	GPIOB->BOR = GPIO_PIN_6
//#define	SCK_ON		GPIOA->BCR = GPIO_PIN_15
//#define	SCK_OFF		GPIOA->BOR = GPIO_PIN_15
//#define	DATA_0		GPIOB->BCR = GPIO_PIN_5
//#define	DATA_1		GPIOB->BOR = GPIO_PIN_5
#endif
